{include file='../Common/read-header.html'}
<!--二维码-->
<div class="erweimas">
	<div class="erwie"><img src="{$_C.hy_path}images/read/erwie.png" width="452" height="500"/></div>
</div>
<!--内容-->
<div class="xiang">
	<div class="gu">
    	<img class="xiangshui" src="{$_C.hy_path}images/read/xiangshui.png" width="540" height="540"/>
        <img class="btn_p4lingqu" src="{$_C.hy_path}images/read/btn_p4lingqu.png" width="385" height="87" />
        <img class="btn_p4liaojie" onClick="toUrl('http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MjM5ODg0MTY5Mw==#wechat_webview_type=1&wechat_redirect')" src="{$_C.hy_path}images/read/btn_p4liaojie.png" width="385" height="87" />
    </div>
</div>
<!--返回-->
<div class="foot">
	<!--<a  href="index.php?g=mobile&m=read&a=index"><img src="{$_C.hy_path}images/read/fang.png"/></a>-->
	<a  href="javascript:history.back();"><img src="{$_C.hy_path}images/read/fang.png"/></a>
</div>
<div class="mask_zzc"></div>
<div class="alert" id="alert2" style="padding:15px">
	
	<div id="msg" class="fs3"></div>
	<a href="javascript:void(0)" class="alert-btn fc1 fs3">确定</a>
	
</div>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<script type="text/javascript">
	var is_send = false;
	wx.config({
		    debug: false, 
		   appId: '{$jsdk.appId}',
				timestamp: {$jsdk.timestamp},
				nonceStr: '{$jsdk.nonceStr}',
				signature: '{$jsdk.signature}',
		    jsApiList: [
		      // 所有要调用的 API 都要加到这个列表中
			  'onMenuShareTimeline',
	      	  'onMenuShareAppMessage',
		      'addCard',
			  'chooseWXPay'
		     
		    ]
		  });
$(".xiang .gu img:eq(1)").click(function(){
		if(is_send)return false;
		is_send = true;
		showMsg("领取卡券中...");
		var url = "index.php?g=mobile&m=read&a=ajaxCard";
				$.post(url,{},function(cardlist){
					 wx.addCard({
			              cardList: cardlist,
			              success: function (res) {
						  	showMsg("领取成功。");
			              }
			            });
					is_send = false;
				},"json");
	})
		  
$('a.alert-btn').click(function (e) {
		$('div.alert').hide();
		$('.mask_zzc').hide();
	});
	function showMsg(msg){
		$("#msg").html(msg);
		$('#alert2').show();
		$('.mask_zzc').show();
	 }
   function showMsg2(msg,url){
		$('a.alert-btn').unbind("click");
		$('a.alert-btn').click(function(){
			console.info(url);
			window.location.href = url;
		});
		$("#msg").html(msg);
		$('#alert2').show();
		$('.mask_zzc').show();
 }	
	
	

	function toua(){
			$(".foot").fadeIn(800)
		}
	setInterval(toua,500);
	 wx.ready(function () {
			
			 wx.onMenuShareTimeline({
			    title: '阅城之味',
			     link:'http://g4.shfyuan.com/ws/index.php?g=mobile&m=read&a=index',
			     imgUrl: 'http://g4.shfyuan.com/ws/Mobile/Webroot/gf/images/read/read-share.png',
			      trigger: function (res) {
			       
			      },
			      success: function (res) {
			    	 // document.getElementById('mcover').style.display='';
					//	showMsg("分享成功。");
			      },
			      cancel: function (res) {
			       
			      },
			      fail: function (res) {
			        showMsg(JSON.stringify(res));
			      }
		    });
		    
			wx.onMenuShareAppMessage({
			    link:'http://g4.shfyuan.com/ws/index.php?g=mobile&m=read&a=index',
			     title: '阅城之味',
			   	desc: '用心去看、去经历方寸间，感受不同的城市、异样的人生',
			  	imgUrl: 'http://g4.shfyuan.com/ws/Mobile/Webroot/gf/images/read/read-share.png',
			    success: function () { 
			    	//document.getElementById('mcover').style.display='';
			    	//showMsg("分享成功。");
			    },
			    cancel: function () { 
			        // 用户取消分享后执行的回调函数
			    }
		});
});
</script>
</body>
</html>
